home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Str / c / strlencr < prev    next >
Text File  |  1995-07-09  |  1KB  |  32 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Misc.strlencr.c
  12.     Author:  Copyright © 1992 Jason Williams
  13.              Thanks to John Winters for supplying the code that I hacked
  14.              changed, hacked, rewrote, and then wrote again from scratch!
  15.     Version: 1.10 (29 Mar 1992)
  16.     Purpose: Find length of CR-terminated string
  17. */
  18.  
  19.  
  20. #include "DeskLib:Str.h"
  21.  
  22. extern int strlencr(char *s)
  23. /* return number of bytes needed to store this string, including terminator */
  24. {
  25.   register int index = 0;
  26.  
  27.   while (s[index] > 31)
  28.     index++;
  29.  
  30.   return(index);
  31. }
  32.